package com.bjfu.dto;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDateTime;

public class ArticleDTO {

    private Long article_id;          // 文章 ID
    private String title;             // 标题
    private Integer category;         // 类别（文章类别，1，2，3..）
    private String summary;           // 摘要
    private String content;           // 内容
    private String attachment_link;   // 附件链接
    private LocalDateTime publish_date; // 发布日期
    private Long team_id;             // 团队 ID
    private Integer status;           // 状态，0草稿，1待审核，2审核通过，3审核失败，4隐藏

    // Getter 和 Setter 方法

    public Long getArticle_id() {
        return article_id;
    }

    public void setArticle_id(Long article_id) {
        this.article_id = article_id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getCategory() {
        return category;
    }

    public void setCategory(Integer category) {
        this.category = category;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getAttachment_link() {
        return attachment_link;
    }

    public void setAttachment_link(String attachment_link) {
        this.attachment_link = attachment_link;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public LocalDateTime getPublish_date() {
        return publish_date;
    }

    public void setPublish_date(LocalDateTime publish_date) {
        this.publish_date = publish_date;
    }

    public Long getTeam_id() {
        return team_id;
    }

    public void setTeam_id(Long team_id) {
        this.team_id = team_id;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "ArticleDTO{" +
                "article_id=" + article_id +
                ", title='" + title + '\'' +
                ", category=" + category +
                ", summary='" + summary + '\'' +
                ", content='" + content + '\'' +
                ", attachment_link='" + attachment_link + '\'' +
                ", publish_date=" + publish_date +
                ", team_id=" + team_id +
                ", status=" + status +
                '}';
    }
}
